/*
 * @Author: yanjikun
 * @Date: 2022-04-21 15:14:28
 * @LastEditors: yanjikun
 * @LastEditTime: 2022-04-22 09:57:14
 * @Description: file content
 */

import { ModalProps } from 'ant-design-vue'

export interface HookModalProps extends Partial<ModalProps> {
  content?: string | JSX.Element | (() => JSX.Element)
  visible?: boolean
  closeModal?: () => void
  isAppChild?: boolean
}

export interface FormModalProps<T = any> extends HookModalProps {
  /**
   * 接受返回一个boolean，返回 true 会关掉这个弹窗
   *
   * @name 表单结束后调用
   */
  onFinish?: (formData: T) => Promise<boolean | void>
  /**
   * 接受返回一个boolean，返回 true 会关掉这个弹窗
   *
   * @name 表单验证失败时调用
   */
  onFail?: (formData: T) => any
}
